<?php
/*this include file creates the body
 *  (<option value=".... bit) of a drop down list
*  showing all non-deleted staff
*/

include($_SERVER['DOCUMENT_ROOT']."/f21na/inc_files/utils/dbconnection.php");
//query for all users
$query ="SELECT UserID, FirstNAme, LastName FROM staff WHERE Deleted != 1";
$result = $mysqli->query( $query );

//count the number of returned results
$resultCount = $result->num_rows;

//if there are some results returned create a table showing the results
if( $resultCount > 0){
	while($row = mysqli_fetch_array($result))
	{
		echo "<option value=\"".$row['UserID']."\">".$row['FirstNAme']." ".$row['LastName']."</option>";
	}

}

//tidy up database connection
$mysqli->close();
?>